-- destruction_mark
-- created by zhuangsl
-- 攻击时，烙印或清除毁灭印记

return {
    apply = function(prop, baseValue)
        return prop[3];
    end,

    -- 攻击触发
    trigger = function(who, prop, arg)
        local target = arg;

        if CombatStatusM.checkStatus(arg, "destruction") then
            -- 如果目标身上已有毁灭印记状态，则去掉这个状态
            CombatStatusM.clearStatus(target, "destruction");

            -- 触发特技发动事件
            EventMgr.fire(event.SPECIAL_SKILL_TRIGGER, { propId = prop[1] });
        else
            -- 如果目标身上没有印记，则记下毁灭印记
            local condition = {
                ["id"] = PropM.getPropId("destruction"),
                ["value"] = prop[3],
                ["end_round"] = -1,
            };

            -- 附加状态
            CombatStatusM.applyStatus(target, "destruction", condition);
        end
    end,

    record = function(target, prop, path)
        return false;
    end
};